package com.ruoyi.spspublic.domain.dto;

import com.ruoyi.common.utils.DateUtils;
import lombok.Data;

import java.util.Date;

@Data
public class CommonAttributeDTO {
  private String ctName;
  private String ctIssuanceNotice;
  private String ctReviewNotice;
  private String createUser;
  private String ctInceptP;
  private String ctBranch;
  private Date createDate;

  public static String toSQL(String tableName, String businessNo) {
    return "SELECT ct_name as ctName, ct_branch as ctBranch, ct_issuance_notice as ctIssuanceNotice, ct_review_notice as ctReviewNotice, dt_create_date as createDate, ct_create_user as createUser ,ct_incept_p as ctInceptP from "
        + tableName
        + " WHERE ct_id = '"
        + businessNo
        + "';";
  }

  public String getCreateDate() {
    return DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, this.createDate);
  }
}
